# -*- coding: utf-8 -*-
__author__ = 'JK'
__date__ = '2019/5/19 13:48'


import django_filters
from django.db.models import Q
from .models import Testcase

class TestcaseFilter(django_filters.rest_framework.FilterSet):
    """
    用例过滤
    """
    id_min = django_filters.NumberFilter(field_name="id", help_text="最低排序", lookup_expr='gte')
    id_max = django_filters.NumberFilter(field_name="id", help_text="最高排序", lookup_expr='lte')

    title = django_filters.CharFilter(field_name='case_title', lookup_expr='icontains')

    class Meta:
        model = Testcase
        fields = ['title', 'id_min', 'id_max']